package com.easy;

/**
 * Created by Lxk on 2020/2/22.
 */
class GuessGame {

    int guess(int num) {
        return 6 - num;
    }

}

class Solution extends GuessGame {

    public int guessNumber(int n) {
        int num = n;
        while (true) {
            if (guess(num) > 0) {
                num--;
            } else if (guess(num) < 0) {
                num++;
            } else {
                return num;
            }
        }
    }

}

public class Solution374 {

    public static void main(String[] args) {
        Solution solution = new Solution();
        System.out.println(solution.guessNumber(10));
    }
}
